var conf = require("./webpackConfig")
var merge = require('webpack-merge')
const webpack = require('webpack');
var path = require('path');
var utils = require('./utils')
var projectRoot = path.resolve(__dirname, '../') + "/"
var CompressionWebpackPlugin = require('compression-webpack-plugin');


Object.keys(conf.entry).forEach(function (name) {

    switch (name) {
        case "app":
            conf.entry.app = './src/main.js'
            break;

        default:
            break;
    }

})


module.exports = merge(conf, {


    plugins: [
        new CompressionWebpackPlugin({ //gzip 压缩
            asset: '[path].gz[query]',
            algorithm: 'gzip',
            test: new RegExp(
                '\\.(js|css)$'    //压缩 js 与 css
            ),
            threshold: 10240,
            minRatio: 0.8
        })
    ]


})